<%-- 
    Document   : index
    Created on : 29.4.2011, 11:45:23
    Author     : pyty
--%>

<%@page contentType="text/html;charset=utf-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 
<html>
    <head>
        <title>Pridanie média</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    </head>
    <body>
        <h2>Zadejte informácie o médiu</h2>
        <c:if test="${not empty chyba}">
            <div style="border: solid 1px red; background-color: yellow; padding: 10px">
                <c:out value="${chyba}"/>
            </div>
        </c:if>
        <form action="${pageContext.request.contextPath}/ZpracovaniServlet" method="post">
        <table>
            <tr>
                <th>Názov:</th>
                <td><input type="text" name="name" value="${fn:escapeXml(name)}" /></td>
            </tr>
            <tr>
                <th>Autor:</th>
                <td><input type="text" name="author" value="${fn:escapeXml(author)}" /></td>
            </tr>
            <tr>
                <th>Typ:</th>
                <td>
                    <select name="type">
                        <option value="DVD"  <c:if test="${type == 'DVD'}" >  selected="selected" </c:if> >DVD</option>
                        <option value="Book" <c:if test="${type == 'Book'}" >  selected="selected" </c:if> >Kniha</option>
                        <option value="CD" <c:if test="${type == 'CD'}" >  selected="selected" </c:if> >CD</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th>Popis:</th>
                <td><input type="text" name="description" value="${fn:escapeXml(description)}" /></td>
            </tr>
        </table>    
        <input type="Submit" value="Uložiť" />
        </form>    
            <a href="${pageContext.request.contextPath}/MediumList" >Zoznam médií</a>
    </body>
</html>